/*
 * mysocket.h
 *
 *  Created on: Apr 28, 2014
 *      Author: kappa
 */

#ifndef PKSOCKET_H_

#define PKSOCKET_H_

#ifdef _WIN32
#include <windows.h>
#pragma comment(lib, "WS2_32.lib")
#else
	#include <sys/socket.h>
	#include <sys/un.h>
	#include <arpa/inet.h>
	#include <unistd.h>
	#include <sys/types.h>
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include "utils/commons.h"
#include "utils/errors.h"


#define LOC_HOST "127.0.0.1"

void initServerSocket(unsigned short int *, unsigned int *, struct sockaddr_in *);
//unsigned int initClientSocket(char *, unsigned short int);
char * readSocketBlock(unsigned int*, int*);
struct sockaddr_in * waitIncomingConnections(unsigned int *,unsigned int *,struct sockaddr_in *);
char * readSockData(unsigned int *);
void sendSockData(unsigned int *, char * );
void closeBidirSocket(unsigned int *);
int setNonblocking(int);
//char** lookupHost (char *);

#endif /* MYSOCKET_H_ */
